<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标事件</title>
    <style type="text/css">
       div{
            width: 10px;
            height: 10px;
            background: green;
            position: absolute;
       }
    </style>
</head>
<body>
<script type="text/javascript">
       window.onload=function(){
           var odiv=document.getElementsByTagName("div");
           document.onmousemove=function(e){
               for(var i=odiv.length-1;i>0;i--){
                   odiv[i].style.left=odiv[i-1].style.left
                   odiv[i].style.top=odiv[i-1].style.top
               }
               odiv[0].style.left=e.pageX+"px"
               odiv[0].style.top=e.pageY+"px"

           }


       }
</script>
<!--9个div-->
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</body>
</html>